package com.hengpeng.itfin.persist.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.hengpeng.common.persist.AbstractDao;
import com.hengpeng.common.persist.query.DynamicQuery;
import com.hengpeng.itfin.persist.UserBankCardDao;
import com.hengpeng.itfinbase.persist.UserBankCard;

/**
 * <pre>
 * 银行卡管理持久层实现
 * </pre>
 * @author shanguogang
 * @version 1.0, 2015-8-6
 */
@Repository
public class UserBankCardDaoImpl extends AbstractDao<UserBankCard> implements UserBankCardDao
{

	@Override
	public List<UserBankCard> findUserBankCardByUserName(String userName)
	{
		DynamicQuery query = new DynamicQuery(UserBankCard.class);
		query.eq("userName", userName);
		return super.findAllByDynamicQuery(query);
	}

	/**
	 * <pre>
	 * 查询银行卡
	 * </pre>
	 * @param userName
	 * @param bankCardNo 银行卡号
	 * @return
	 */
	public List<UserBankCard> findUserBankCardByNO(String userName,String bankCardNo){
		DynamicQuery query = new DynamicQuery(UserBankCard.class);
		query.eq("userName", userName);
		query.eq("bankCardNo", bankCardNo);
		return super.findAllByDynamicQuery(query);
	}
}
